﻿<%@ Page Language="C#" MasterPageFile="~/Test.Master" AutoEventWireup="true" CodeBehind="Test.aspx.cs" Inherits="ProjectSem40701.Test" EnableEventValidation="false" Title="Làm bài thi" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <%--<asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>--%>
            <asp:MultiView ID="MultiView1" runat="server">
                
                <asp:View ID="ViewError" runat="server">
                    <!--Show error message here -->
                     <asp:Label ID="lblError" runat="server" Font-Bold="True" ForeColor="#CC0000"></asp:Label>
                </asp:View>
                
                <asp:View ID="ViewPreLoadData" runat="server" 
                    onactivate="ViewPreLoadData_Activate">
                    <!--Show pre-load data here -->
                    <asp:Timer ID="countDownTimerStartTime" runat="server" Enabled="False" 
                        Interval="1000" ontick="countDownTimerStartTime_Tick">
                    </asp:Timer>
                    <asp:Label ID="lblTimeRemain" runat="server" Font-Bold="True" 
                        ForeColor="#CC0000"></asp:Label>
                </asp:View>
                
                <asp:View ID="ViewLoadData" runat="server" onactivate="ViewLoadData_Activate">
                    
                    <!-- Load info here -->
                    <asp:UpdatePanel ID="UpdatePanel2" runat="server">
                        <ContentTemplate>
                            <div class="test_page_button">
						       <asp:Timer ID="timerCountDown" runat="server" Interval="1000" 
                                        ontick="timerCountDown_Tick">
                                </asp:Timer>
						        <asp:Label ID="lblCurrentRound" runat="server" Font-Bold="True" 
                                    ForeColor="#CC0000"></asp:Label>
                                <br />
						        <asp:Label ID="lblTotalTimeLabel" runat="server" Font-Bold="True" 
                                    ForeColor="#CC0000" Text="Thời gian làm bài thi là:"></asp:Label>
                                    <asp:Label ID="lblTotalTime" runat="server" Font-Bold="True" 
                                    ForeColor="#CC0000"></asp:Label>
                                <asp:Label ID="lblTimeRemainLabel" runat="server" ForeColor="#CC0000" 
                                    Text="Bạn còn: "></asp:Label>
						        
						        <asp:Label ID="lblTimeRemain2" runat="server" ForeColor="#CC0000"></asp:Label>
						        
						    </div>
                        </ContentTemplate>
                    </asp:UpdatePanel>
                    <!--Load data here -->
                    <div class="test_page_content">
                        <asp:GridView ID="grvQA" runat="server" AutoGenerateColumns="False" 
                                                DataKeyNames="QuestionID" GridLines="None" 
                            Width="100%" AllowPaging="True" ondatabound="grvQA_DataBound">
                            <Columns>
                                <asp:TemplateField ShowHeader="False" SortExpression="QuestionTittle">
                                    <ItemTemplate>
                                        <div class="one_question">
					                        <span>
					                            <asp:Literal ID="ltrQuestionTittle" runat="server"></asp:Literal>
					                        </span> 
						                    
                                                <asp:Literal ID="ltrContent" runat="server" 
                                                    Text='<%# Bind("QuestionContent") %>' 
                                                    ondatabinding="ltrContent_DataBinding"></asp:Literal>
                                            
				                            <asp:Label ID="lblQID" runat="server" 
                                                Text='<%# Bind("QuestionID") %>' Visible="False"></asp:Label>
                                            <asp:Literal ID="ltrMark" runat="server" Text='<%# Bind("QuestionMark") %>' 
                                                Visible="False"></asp:Literal>
				                        </div>
                                        <asp:GridView ID="grvAnswer" runat="server" AutoGenerateColumns="False" 
                                            DataKeyNames="AnswerID" DataSourceID="ObjectDataSource1" GridLines="None" 
                                            ShowHeader="False">
                                            <Columns>
                                                <asp:TemplateField HeaderText="AnswerID" InsertVisible="False" 
                                                    SortExpression="AnswerID">
                                                    <ItemTemplate>
                                                        <div class="one_answer">
					                                        <span>
                                                                <asp:Literal ID="ltrTittle" runat="server" 
                                                                Text='<%# Bind("AnswerTitle") %>'></asp:Literal>:
                                                            </span> 
                                                            <asp:CheckBox ID="chkbCorrect" runat="server" 
                                                                Text='<%# Bind("AnswerContent") %>' 
                                                                ondatabinding="chkbCorrect_DataBinding" />                                                 
				                                            <asp:Literal ID="ltrAnsID" runat="server" Text='<%# Bind("AnswerID") %>' 
                                                                Visible="False"></asp:Literal>
				                                        </div>
                                                    </ItemTemplate>
                                                </asp:TemplateField>
                                            </Columns>
                                        </asp:GridView>
                                        <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" 
                                            OldValuesParameterFormatString="original_{0}" 
                                            SelectMethod="Get_tbl_Answer_Select_All_By_QuestionID" 
                                            TypeName="ProjectSem40701.MainDataset.AnswerTableAdapters.tbl_AnswerTableAdapter">
                                            <SelectParameters>
                                                <asp:ControlParameter ControlID="lblQID" Name="qid" PropertyName="Text" 
                                                    Type="Int32" />
                                            </SelectParameters>
                                        </asp:ObjectDataSource>
                                    </ItemTemplate>
                                </asp:TemplateField>
                            </Columns>
                            <EmptyDataTemplate>
                                Không có dữ liệu
                            </EmptyDataTemplate>
                            <AlternatingRowStyle Wrap="False" />
                        </asp:GridView>
                    </div>
                    <div class="test_page_button">
                        <asp:Button ID="btnSubmit" runat="server" Text="Nộp bài thi" CssClass="button2" 
                                onclick="btnSubmit_Click" />
					</div>
                </asp:View>
                   
                <asp:View ID="ViewComplete" runat="server">
                    <!--Show complete message here -->
                     <asp:Label ID="lblComplete" runat="server" Font-Bold="True" 
                        ForeColor="#CC0000"></asp:Label>
                </asp:View>
                        
            </asp:MultiView>
        <%--</ContentTemplate>
    </asp:UpdatePanel>--%>
</asp:Content>
